<?php
namespace app\mall\controller;

use app\mall\logic\announcementLogic;
use think\admin\Controller;
use think\Exception;

class Announcement extends Controller{

    //公告列表
    public function announcement_list(){
        $logic = new announcementLogic();
        $data = $logic->announcement_list();
        $this->success('公告列表',$data);
    }

    //问题分类
    public function problem_class_list(){
        $logic = new announcementLogic();
        $data = $logic->problem_class_list();
        $this->success('问题分类',$data);
    }

    //问题列表
    public function problem_list(){
        $id = request()->param('id',0);
        $logic = new announcementLogic();
        $data = $logic->problem_list($id);
        $this->success('问题列表',$data);
    }

    //联系客服
    public function customer_service(){
       /* $customer_service_qq = sysdata('customer_service_qq')?:'';
        $customer_service_phone = sysdata('customer_service_phone')?:'';
        $customer_service_time = sysdata('customer_service_time')?:'';
        $invite_register_integral = sysdata('invite_register_integral')?:'';
        $data = array(
            'customer_service_qq' => $customer_service_qq,//客服在线请求
            'customer_service_phone' => $customer_service_phone,//客服电话
            'customer_service_time' => $customer_service_time,//客服在线时间
            'invite_register_integral' => $invite_register_integral,//拉新注册返积分
        );*/
        $data = sysdata('customer_service');
        $this->success('联系客服',$data);
    }

    //用户充值协议
    public function recharge_agreement(){
        $data = sysdata('recharge_agreement_edit');
        $this->success('用户充值协议',$data);
    }

    //充值活动
    public function recharge_activity(){
        $data = sysdata('recharge_activity_edit');
        $this->success('充值活动',$data);
    }

    //新人必看
    public function newpeople_read(){
        $data = sysdata('newpeople_read_edit');
        $this->success('新人必看',$data);
    }

    //必看指南
    public function guide_read(){
        $data = sysdata('guide_read_edit');
        $this->success('必看指南',$data);
    }

    //统一获取富文本
    public function sysContent(){
        $key = $this->request->get('key');
        try{
            $this->success('获取成功',sysdata($key));
        }catch(Exception $e){
            $this->success('没有找到数据');
        }
    }





}